﻿using System;
using System.Collections.Generic;
using System.Text;

namespace SHRIS.MIS.Common.Util
{
    public static class StringExtensions
    {
        public static string SubExceptionMessage(this string instance, int startIndex,int subLength)
        {
            if(string.IsNullOrEmpty(instance))
            {
                return instance;
            }

            if(instance.Length-startIndex<subLength)
            {
                return instance.Substring(startIndex);
            }
            else
            {
                return instance.Substring(startIndex, subLength);
            }
        }
    }
}
